<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['运维管理[环卫]','故障类型配置']" icon="fa fa-newspaper-o"
			class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>

	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>故障类型配置</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
								<button class="btn btn-primary" (click)="addShowModal(FaultTypeConfigurationModal)">添加</button>
							</div>
						</div>
						<div class="table_scroll">
							<div class="table_flex">
								<div class="table_header">
									<span>[一级]故障类型</span>
									<div class="table_header_btn" *ngIf="provinceSelected">
										<!-- <button type="button" (click)="regionEdit(provinceSelected, FaultTypeConfigurationModal)">[编辑]</button> -->
										<!-- <button type="button" (click)="regionDelete(2)">[删除]</button> -->
									</div>
								</div>
								<div class="table_content">
									<input type="text" [(ngModel)]="provinceKey" (ngModelChange)="tableSearch(2)" class="fliter_search_input" placeholder="请输入故障类型名称进行过滤">
									<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
										<thead>
											<tr>
												<th>故障编号</th>
												<th>故障类型名称</th>
											</tr>
										</thead>
										<tbody>
											<tr *ngFor="let row of provinceList; let i = index" [ngClass]="{selected:provinceSelected === row.id}" (click)="rowSelectEvent(row, 3)">
												<td>{{row.type}}</td>
												<td>{{row.typeName}}</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
							<div class="table_flex">
								<div class="table_header">
									<span>[二级]故障类型</span>
									<div class="table_header_btn" *ngIf="citySelected">
										<!-- <button type="button" (click)="regionEdit(citySelected, FaultTypeConfigurationModal)">[编辑]</button> -->
										<button type="button" (click)="regionDelete(3)">[删除]</button>
									</div>
								</div>
								<div class="table_content">
									<input type="text" [(ngModel)]="cityKey" (ngModelChange)="tableSearch(3)" class="fliter_search_input" placeholder="请输入故障类型名称进行过滤">
									<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
										<thead>
											<tr>
												<th>故障编号</th>
												<th>故障类型名称</th>
											</tr>
										</thead>
										<tbody>
											<tr *ngFor="let row of cityList; let i = index" [ngClass]="{selected:citySelected === row.id}" (click)="rowSelectEvent(row, 4)">
												<td>{{row.type}}</td>
												<td>{{row.typeName}}</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
							<!-- <div class="table_flex">
								<div class="table_header">
									<span>[三级]故障类型</span>
									<div class="table_header_btn" *ngIf="countySelected">
										<button type="button" (click)="regionDelete(4)">[删除]</button>
									</div>
								</div>
								<div class="table_content">
									<input type="text" [(ngModel)]="countyKey" (ngModelChange)="tableSearch(4)" class="fliter_search_input" placeholder="请输入故障类型名称进行过滤">
									<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
										<thead>
											<tr>
												<th>故障编号</th>
												<th>故障类型名称</th>
											</tr>
										</thead>
										<tbody>
											<tr *ngFor="let row of countyList; let i = index" [ngClass]="{selected:countySelected === row.id}" (click)="rowSelectEvent(row, 'no')">
												<td>{{row.type}}</td>
												<td>{{row.typeName}}</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div> -->
						</div>
						<div class="table-fix clearfix">
							<!-- <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
								(onPageChange)="paginate($event)">
							</paginator> -->
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>
<!-- 新增-行政区划   弹窗-->
<section bsModal #FaultTypeConfigurationModal="bs-modal" class="modal fade" tabindex="-1" role="dialog"
	aria-labelledby="myLargeModalLabel" aria-hidden="true">
	<div class="modal-dialog modal-lg" style="width: 500px;">
		<div class="modal-content">
			<div class="modal-header">
				<h4 class="modal-title">添加</h4>
			</div>
			<form class="form-horizontal" role="form" novalidate="novalidate">
				<div class="modal-body">
					<div class="row form-horizontal">
						<!-- <div class="form-group col-xs-12">
							<label class="control-label col-sm-4 no-padding-right">故障类型所属层级<sup>*</sup></label>
							<div class="col-sm-8">
								<select class="form-control" name="level" [(ngModel)]="addRegion.level" (change)="changeLevel($event.target.value)" [disabled]="editState">
									<option *ngFor="let item of levelOption" [value]="item.value">{{item.text}}</option>
								</select>
							</div>
						</div> -->
						<div class="form-group col-xs-12" *ngIf="addRegion.level == 3 || addRegion.level == 4">
							<label class="control-label col-sm-5 no-padding-right">故障类型[一级]<sup>*</sup></label>
							<div class="col-sm-7">
								<select class="form-control" name="provinceId" [(ngModel)]="provinceId" (change)="changeProvinceOption($event.target.value)" *ngIf="!editState">
									<option value="">请选择</option>
									<option *ngFor="let item of provinceList" [value]="item.id">{{item.typeName}}</option>
								</select>
								<select class="form-control" name="provinceId" disabled *ngIf="editState">
									<option value="">{{twoAreaName}}</option>
								</select>
							</div>
						</div>
						<div class="form-group col-xs-12" *ngIf="addRegion.level == 4">
							<label class="control-label col-sm-5 no-padding-right">上级故障类型[二级]<sup>*</sup></label>
							<div class="col-sm-7">
								<select class="form-control" name="cityId" [(ngModel)]="cityId" (change)="changeCityOption($event.target.value)" *ngIf="!editState">
									<option value="">请选择</option>
									<option *ngFor="let item of cityList" [value]="item.id">{{item.typeName}}</option>
								</select>
								<select class="form-control" name="cityId" disabled *ngIf="editState">
									<option value="">{{threeAreaName}}</option>
								</select>
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-sm-5 no-padding-right">故障编号[二级]<sup>*</sup></label>
							<div class="col-sm-7">
								<input class="form-control"  [(ngModel)]='addRegion.type' name='type' placeholder="请输入故障编号" autocomplete="off" (keydown)="keyupAreaNumber($event)" />
							</div>
						</div>
						<div class="form-group col-xs-12">
							<label class="control-label col-sm-5 no-padding-right">故障类型名称[二级]<sup>*</sup></label>
							<div class="col-sm-7">
								<input class="form-control" type="text" [(ngModel)]='addRegion.typeName' name='typeName' placeholder="请输入故障类型名称" autocomplete="off" />
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="addRegionClose(FaultTypeConfigurationModal)">取消</button>
					<button type="button" class="btn btn-primary" (click)="addRegionSubmit(FaultTypeConfigurationModal)">确定</button>
				</div>
			</form>
		</div>
	</div>
</section>
<!-- 新增-行政区划 弹窗end-->
<style type="text/css">
	.table_scroll {
		display: flex;
		margin-bottom: 60px;
	}
	.table_flex {
		flex: 1;
		height: auto;
		margin-right: 20px;
		border: 1px solid #ddd;
	}
	.table_flex:last-child {
		margin-right: 0;
	}
	.table_header {
		height: 35px;
		border-color: #0C192C!important;
    background: #0C192C;
    color: #fff;
		padding: 0 10px;
		display: flex;
		justify-content: space-between;
		text-align: center;
	}
	.table_header span {
		line-height: 35px;
	}
	.table_header .table_header_btn {
		display: flex;
		text-align: center;
	}
	.table_header button {
		color: #fff;
		margin-left: 15px;
		margin-right: 0;
	}
	.table_content {
		box-sizing: border-box;
		padding: 10px;
		padding-top: 0;
		max-height: 650px;
		overflow: scroll;
		scrollbar-width: none;
	}
	.table_content::-webkit-scrollbar {
		display: none; /* Chrome Safari */
	}
	.fliter_search_input {
		width: 100%;
		height: 35px;
		margin: 10px 0;
		font-size: 14px;
		padding: 5px 8px;
		border: 1px solid #ddd;
	}
</style>